<template>
    <div>
        <input type="button" value="确认购买" @click="paybutton">
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {

        }
    },
    methods: {
        paybutton(){
            var data = {
                'goods_id':1,
                'username':'wangp'
            }
            axios({
                url:'http://127.0.0.1:8000/proapp/pay_url/',
                method:'post',
                data:data
            }).then(res=>{
                console.log(res.data)
                window.location.href = res.data.data.pay_url
            })
        }
    },
    created() {

    }
}
</script>

<style scoped>

</style>
